package com.css.bjdt_core.operationLog.service;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.nutz.dao.Dao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.css.bjdt_core.operationLog.entity.RptBjdtLog;
import com.css.bjdt_core.util.CommonUtil;

@Service
public class RptBjdtLogService {

	@Autowired
	private Dao dao;

	public void saveOperationInfo(String operationUser, String operationInfo, String operationType) {
		RptBjdtLog rptBjdtLog = new RptBjdtLog();

		rptBjdtLog.setLogId(CommonUtil.getUUID());
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		rptBjdtLog.setOperationTime(df.format(new Date()));
		rptBjdtLog.setOperationInfo(operationInfo);
		rptBjdtLog.setOperationType(operationType);
		rptBjdtLog.setOperationUser(operationUser);
		dao.insert(rptBjdtLog);
	}
}
